;; (println "hello world")
;; (defn hello-world [username]
;;  (println (format "hello, %s" username)))

;;[1 2 3 4]
;;[1,2,3,4]
;;(cond ((= x 10) "equal")
;;      ((> x 19) "more"))

;;(cond (= x 10) "equal"
;;      (> x 19) "more")

;; (defrecord name [arg1 arg2 arg3])

;; (defrecord name [Type :arg1 Type :arg2 Type :arg3]
;;  :allow-nulls false)

;; namespace is that
;; (class (hash-map :a 1 :b 2 :c 3))
;; (def keymap {:a 1 :b 2 :c 3})
;; Use assoc to add new keys to hash-maps
;; (def newkeymap (assoc keymap :d 4))
;; newkeymap ; but remember clojure types are immutable
;; (dissoc keymap :a :b)
;; (set [1 2 3 1 2 3])
;; (conj #{1 2 3} 4)
;; (disj #{1 2 3} 1)
;; (#{1 2 3} 1)
;; (reduce conj [] '(3 2 3))
;; (def hello-world (fn [] "hello world")) should be forget
;; should use (defn hell-world [] "hello world")
;; (defn hello [name] (str "hello " name))
;; (hello "steve")


(defn hello [n]
  (if (< n 1) (println "over")
    (let [n (- n 1)]
    (println n)
    (hello n))))

(hello 100)

(first ())
(if 0 (println "true"))
(if nil (println "true"))
(if "" (println "true"))
(first '(:r2d2 :c3po))
(last '(:r2de :c3po))
(rest '(:r2d2 :c3po))
(cons :battle-droid '(:r2d2 :c3po))
(first [:hutt :wookie :ewolk])
(nth [:httt :ddd :dddd] 2)
([:hutt :wookie :ewok] 2)
(concat [:darth-vader] [:darth-maul])
(slurp f & args)
;; get the model of function 
#'vec
(resolve 'vec)
(def foo 1)
(resolve 'foo)
(in-ns 'hello) ;; switch the namespace
;; when switch an namespace, should load all core function
(re-pattern "\\d+") ;; transform the string to pattern
;; if clojure is \\, I want use racket
;; racket is seldom syntax sugar
(use '[clojure.string :only (join split)])
(seq "abc") => (\a \b \c)
(join (seq "abc")) => "abc"
